#ifndef DBTABTABVERSION_H
#define DBTABTABVERSION_H

#include "dbtabbase.h"

class DBTabTabVersion : public DBTabBase
{
public:
    static DBTabTabVersion *getDBTab(){
        static DBTabTabVersion tab;
        return &tab;
    }
    static const ColumnInfo mColumnTab[];
    static const QLatin1String TAB_NAME;
    static const char *_TAB_NAME;
    static const char *_TAB_VER;
    enum{
        INDEX_ID,
        INDEX_TAB_NAME,
        INDEX_TAB_VER,
        INDEX_END,
    };

private:
    DBTabTabVersion();

    // DBTabBase interface
public:
    void createTab(QSqlDatabase &db=DataBase::getDataBase());
    static void setVersion(const QString &tab_name, int version, QSqlDatabase &db=DataBase::getDataBase());
    static int getVersion(const QString &tab_name, QSqlDatabase &db=DataBase::getDataBase());
    static void incVersion(const QString &tab_name, QSqlDatabase &db=DataBase::getDataBase());
};

#endif // DBTABTABVERSION_H
